// 用户相关得儿接口
import request from "@/utils/request"
import type { loginfrom, LoginReturn, userdata, LogOut } from "./type"
enum API {
  // 登陆接口
  // LOGIN_URL = '/admin/acl/index/login',
  LOGIN_URL = "/admin/acl/index/login",

  USERINFO_URL = "/admin/acl/index/info",
  // 退出
  // LOGOUT_URL = '/admin/acl/index/logout',
  LOGOUT_URL = "/admin/acl/index/logout",
}
// 导出登陆函数
export const reqLogin = (data: loginfrom) =>
  request.post<LoginReturn>(API.LOGIN_URL, data)
//获取用户信息
export const reqUserInfo = () => request.get<userdata>(API.USERINFO_URL)
// 退出的登陆
export const reqUserlogout = () => request.post<LogOut>(API.LOGOUT_URL)
